# This is a sample Python script.

# Press ⌃R to execute it or replace it with your code.
# Press Double ⇧ to search everywhere for classes, files, tool windows, actions, and settings.
import torch
import numpy as np

x = np.array([[3, 3, 1], [1, 2, 3]])
x = torch.from_numpy(x)
print(x)


y = torch.empty(x.shape).log_normal_(mean=0, std=1)

y = torch.empty(x.shape).uniform_(0, 1)

batch, n, m, p = 32, 10, 20, 30

x = torch.randn(batch, n, m)
y = torch.randn(batch, m, p)

z = torch.bmm(x, y)
print(z.shape)

print(z.eq(torch.matmul(x, y)).all())

x = torch.arange(10)
print(x.remainder(2) == 0)

print(x.sum(dim=-1).shape)


x = torch.arange(12).view(1, 1, 12)
print(x.squeeze(1))
print(x.shape)


#
x = torch.tensor([1, 2, 3])
y = x[:]
x[0] = 2
print(x, y)

x = torch.ones(2, 3, 3)
print(x[:, 0, :].shape)

x = torch.ones(3)
y = torch.ones(3)
z = torch.concat((x, y))
x[0] = 2
y[0] = 2
print(z)


